package top.infopub.io.impl;


import java.util.LinkedList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

import top.infopub.io.ContentHandler;


/**
 * SimpleContentHandler
 * @author Awoke
 * @version 2018年9月13日
 * @see SimpleContentHandler
 * @since
 */
public class SimpleContentHandler implements ContentHandler<List<String>> {

    private List<String> list;

    public SimpleContentHandler() {
        list = new LinkedList<String>();
    }

    @Override
    public void contentHandler(String line) {
        if (StringUtils.isNotEmpty(line) && StringUtils.isNotEmpty(line.replaceAll("\t", ""))) {
            list.add(line);
        }
    }

    @Override
    public List<String> result() {
        return list;
    }

}
